((2A/5+2)*B*C)/D)/50)+2)*X)*Y/10)*Z)/255 A = attacker's Level B = attacker's Attack or Special C = attack Power D = defender's Defense or Special X = same-Type attack bonus (1 or 1.5) Y = Type modifiers (40, 20, 10, 5, 2.5, or 0) Z = a random number between 217 and 255 Full explanations of each variable follow.

function damage_calc()
	z = math.random(217, 255)
	((((((((2*C_pokemon.lv)/5+2)*C_pokemon.spATK*power)/E_pokemon.spDEF)+2)*STAB_status)*0/10)*z)/255
end

